/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/



#if !defined(AFX_PGLMAPCONTOUR_H__CD4BC610_4609_4FC3_ADFD_E1AD86A54B6C__INCLUDED_)
#define AFX_PGLMAPCONTOUR_H__CD4BC610_4609_4FC3_ADFD_E1AD86A54B6C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <pgl/core/PGLMapZ.h>
#include <pgl/algotools/ListContour.h>
#include <pgl/algotools/FieldRegMap.h>

/*!	\brief Height with contouring

\ingroup PGLMapGroup
*/
class PGLCORE_EXT_CLASS CPGLMapContour : public CPGLMapZ  
{
PGL_DECLARE_DYNCREATE(CPGLMapContour);
public:
	typedef contour::TListContour<float> ListContour;

	void GenerateContours();
	//! \name Constructors
	//@{
	CPGLMapContour();
	//! Copy construtor
	CPGLMapContour(const CPGLMapContour& m){*this = m;};
	//! Assignement constructor
	CPGLMapContour& operator=(const CPGLMapContour& m);
	virtual ~CPGLMapContour();
	//@}

	//! \name Contour manipulation
	//@{
	//! Sets contouring plane values
	void SetPlanes(const std::vector<float>& vPlanes)	{	m_contour.SetPlanes(vPlanes);};
	//! Returns a reference to the contour object, const
	const ListContour& GetContour() const				{	return m_contour;};
	//! Returns a referent to the contour object
	ListContour& GetContour()							{	return m_contour;};
	//@}

	//! \name Controlling the appearance
	//@{
	//! returns true if the height map is drawed
	bool IsHeightMapShown() const						{	return m_bShowHeightMap;};
	//! show/hides the height map below the contours
	void SetShowHeightMap(bool bShow = true)			{	m_bShowHeightMap=bShow;};
	//@}

	//! \name Main plot functions
	//@{
	/// plotting
	void PlotGfx(gfxinterface::CGfxInterface& gfx);
	//@}

	//! \name Serialization and debugging
	//@{
	//! Serialize functions
	void SerializeXML(CPGLArchive& ar);

	//! Debuggin functions
	#ifdef _DEBUG
		//! MFC Dump
	    virtual void Dump( CDumpContext& dc ) const;
		//! MFC AssertValid
	    virtual void AssertValid() const;   
	#endif
	//@}
protected:
	//! \name Attributes
	//@{
	ListContour m_contour;
	bool m_bShowHeightMap;
	//@}
};

PGL_DECLARE_SMARTPTR( CPGLMapContour );

#endif // !defined(AFX_PGLMAPCONTOUR_H__CD4BC610_4609_4FC3_ADFD_E1AD86A54B6C__INCLUDED_)
